import fetch from 'common/src/utils/fetch';

/**
 * 查询学分认定开关设置
 */
export function listCompulsoryCourseAuthPage(data = {}) {
    return fetch({
        url:
            '/api/scoremanagementservice/compulsoryCourseAuth/listCompulsoryCourseAuthPage',
        method: 'post',
        data
    });
}

/**
 * 提交课程权限添加
 * @param {*} data
 */
export function saveCompulsoryCourseAuth(data = {}) {
    return fetch({
        url:
            '/api/scoremanagementservice/compulsoryCourseAuth/saveCompulsoryCourseAuth',
        method: 'post',
        data
    });
}

/**
 * 根据id获取必修环节编辑信息
 * @param {*} id
 */
export function findCompulsoryCourseAuthById(id) {
    return fetch({
        url:
            '/api/scoremanagementservice/compulsoryCourseAuth/findCompulsoryCourseAuthById?id=' +
            id,
        method: 'get'
    });
}

export function getPublishCompulsoryScoreList(data = {}) {
    return fetch({
        url:
            '/api/scoremanagementservice/compulsoryCourseScore/getPublishCompulsoryScoreList',
        method: 'post',
        data
    });
}

/**
 * 删除必修环节白名单
 * @param {*} data
 */
export function batchDelCompulsoryAuthWhite(data) {
    return fetch({
        url:
            '/api/scoremanagementservice/compulsoryCourseAuth/batchDelCompulsoryAuthWhite',
        method: 'delete',
        data
    });
}

/**
 * 删除必修环节课程
 * @param {*} data
 */
export function batchDelCompulsoryCourse(data) {
    return fetch({
        url:
            '/api/scoremanagementservice/compulsoryCourseAuth/batchDelCompulsoryCourse',
        method: 'delete',
        data
    });
}

/**
 * 新增保存必修环节白名单
 * @param {*} data
 */
export function saveCompulsoryAuthWhite(data = {}) {
    return fetch({
        url:
            '/api/scoremanagementservice/compulsoryCourseAuth/saveCompulsoryAuthWhite',
        method: 'post',
        data
    });
}

/**
 * 白名单页面查询
 * @param {*} data
 */
export function listCompulsoryAuthWhitePage(data = {}) {
    return fetch({
        url:
            '/api/scoremanagementservice/compulsoryCourseAuth/listCompulsoryAuthWhitePage',
        method: 'post',
        data
    });
}

/**
 * 必修环节成绩录入查询
 * @param {*} data
 */
export function getNeedEnterScoreStudentList(data = {}) {
    return fetch({
        url:
            '/api/scoremanagementservice/compulsoryCourseScore/getNeedEnterScoreStudentList',
        method: 'post',
        data
    });
}

/**
 * 保存必修环节录入成绩
 * @param {*} data
 */
export function saveCompulsoryCourseScore(data = {}) {
    return fetch({
        url:
            '/api/scoremanagementservice/compulsoryCourseScore/saveCompulsoryCourseScore',
        method: 'post',
        data
    });
}
